import { DateTransformer } from './../utils/dateTransformer';
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { Exclude, Expose, Transform, Type } from 'class-transformer';
import { CommonEntity } from './common.entity';

@Entity('video')
export class VideoEntity extends CommonEntity {
    // 将 int 类型的id转成string类型，防止前端精度缺失

    @PrimaryGeneratedColumn({ type: 'bigint' })
    id: string;

    @Column()
    title: string;

    @Column()
    subTitle: string;

    @Column({ comment: '视频海报' })
    poster: string;

    @Column({ comment: '分类id' })
    cateId: string;

    @Column({ comment: '观看次数' ,default:0})
    views: number;

    @Column({ comment: '视频时长' })
    duration: string;

    @Column({ comment: '作者' })
    author: string;

    @Column({ comment: '发布日期' })
    releaseDate: string;

    @Column({ comment: '标签' })
    label: string;

    @Column({ comment: '视频简介' })
    intro: string

    @Column({ comment: '总集数' })
    totals: number;

    @Column({ comment: '当前集数' })
    current: number;

    @Column({ comment: '更新周期',})
    updatePeriod: number;

    @Column({ comment: '1：上映  0：下架',default:1})
    playStatus: number;
}  